
class Base {
    public int a = 1;
    public int b = 2;
}
class Derived extends Base{
    public int a=11;
    public int c=3;

    public void test(){
        System.out.println("a="+this.a);
        System.out.println("a="+super.a);
        System.out.println("b="+this.b);
        System.out.println("c="+this.c);
    }
}
public class Test2 {
    public static void main(String[] args) {
        Derived derived=new Derived();//产生子类对象
        derived.test();//调用子类的test方法
    }
}
